package com.culturaltourism.core.spring;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName: SysWebMvcConfig
 * @Description: 项目配置，需实现WebMvcConfigurer接口
 * @Author MaShuai
 * @Date 2019/5/2 17:47
 * @Version V1.0
 */
@Configuration
public class SysWebMvcConfig implements WebMvcConfigurer {

    private static Logger log = LoggerFactory.getLogger(SysWebMvcConfig.class);

    /**
     * @Description 配置拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.info("加载系统拦截器配置！");
        registry.addInterceptor(new SysInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login", "/css/**", "/img/**", "/js/**", "/lib/**");
    }
}
